package com.zhkc.iess.system.api;

import com.zhkc.iess.system.dto.SysUserAddDTO;
import com.zhkc.iess.system.dto.SysUserQueryDTO;
import com.zhkc.iess.system.dto.SysUserResetPwdDTO;
import com.zhkc.iess.system.vo.SysResourcePermissionVO;
import com.zhkc.iess.system.vo.SysUserVO;
import com.zhkc.wisdom.common.pojo.vo.PageVO;
import com.zhkc.wisdom.common.pojo.vo.ResultVO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import org.springframework.core.annotation.Order;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 用户管理.
 */
@Tag(name = "用户管理接口", description = "用户管理接口")
public interface SysUserApi {

    @Operation(summary = "分页查询", description = "分页查询")
    @GetMapping("/api/auth/pageList")
    @Order(1)
    ResultVO<PageVO<SysUserVO>> pageList(SysUserQueryDTO dto);

    @Operation(summary = "新增用户", description = "新增用户")
    @PostMapping("/api/auth/create")
    @Order(2)
    ResultVO<Long> create(@RequestBody @Valid SysUserAddDTO dto);

    @Operation(summary = "修改用户", description = "修改用户")
    @PostMapping("/api/auth/update/{id}")
    @Order(3)
    ResultVO<Void> update(@PathVariable("id") Long id, @RequestBody @Valid SysUserAddDTO dto);

    @Operation(summary = "删除用户", description = "删除用户")
    @PostMapping("/api/auth/delete/{id}")
    @Order(4)
    ResultVO<Void> delete(@PathVariable("id") Long id);

    @Operation(summary = "启用/禁用用户", description = "启用/禁用用户")
    @PostMapping("/api/auth/updateStatus/{id}")
    @Order(5)
    ResultVO<Void> updateStatus(@PathVariable("id") Long id);

    @Operation(summary = "重置密码", description = "重置密码")
    @PostMapping("/api/auth/resetPwd/{id}")
    @Order(6)
    ResultVO<Void> resetPwd(@PathVariable("id") Long id, @RequestBody @Valid SysUserResetPwdDTO dto);

    @Operation(summary = "角色code获取用户列表", description = "角色code获取用户列表")
    @GetMapping("/api/auth/listByRole")
    @Order(7)
    ResultVO<SysUserVO> listByRole(@RequestParam("roleCode") String roleCode);

    @Operation(summary = "获取菜单权限", description = "获取菜单权限")
    @GetMapping("/api/auth/getResource")
    @Order(8)
    ResultVO<List<SysResourcePermissionVO>> getResource();

}
